<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>表单自定义按钮</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
</head>

<body style="overflow-y: hidden" scroll="no">
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="cgformButtonController.do?saveFieldList">
	<input id="id" name="id" type="hidden" value="${buttonId }">
	<input id="formId" name="formId" type="hidden" value="${formId}">
	<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
		<thead>
			<tr>
				<td>字段名</td>
				<td>数据类型</td>
				<td>外键表</td>
				<%--<td>外键字段</td>--%>

				<td>说明</td>
				<td>是否显示<input type="checkbox" onchange="checkAll('showable',this)"></td>
				<td>是否编辑<input type="checkbox" onchange="checkAll('editable',this)"> </td>
			</tr>
		</thead>
		<tbody id="tbody">
		<c:forEach items="${fieldEntityMap}" var="fi" varStatus="v">
			<tr>
				<input type="hidden" value="${fi.id}" name="fieldConfigs[${v.index}].fieldId">
				<td>${fi.fieldName}</td>
				<td>${fi.type}</td>
				<td class="aa">
						${fi.showType}
				</td>
				<%--<td>${fi.content}</td>--%>
				<td>${fi.content}</td>
				<td>
					<input style="width: 100%" type="checkbox"
						   <c:if test="${configs.get(fi.id).showable}">checked="checked"</c:if>
						   class="showable" name="fieldConfigs[${v.index}].showable">
				</td>
				<td>
					<input id="aa${v.index}" style="${fi.isNull!='N'?'width:100%':''}" type="checkbox"
						   <c:if test="${configs.get(fi.id).editable || fi.isNull=='N'}">checked="checked"</c:if>
						   class="editable" name="fieldConfigs[${v.index}].editable">
					<c:if test="${fi.isNull=='N'}">
						<label for="aa${v.index}">不能为空</label>
					</c:if>
				</td>
			</tr>

		</c:forEach>
		</tbody>

	</table>
</t:formvalid>
<script>
	$(function () {
        $('.aa').each(function () {
            $(this).html(opt[$(this).html().trim()])
        })
    });
	var opt={"text":"文本框", "password":"密码", "money":"金额", "radio":"单选框", "checkbox":"多选", "date":"日期(yyyy-MM-dd)", "datetime":"日期（yyyy-MM-dd HH:mm:ss）", "file":"文件", "textarea":"多行文本", "list":"下拉框", "popup":"popup弹出框", "popselect":"对话弹出选择框", "image":"图片", "umeditor":"UE编辑器"};

</script>
</body>
</html>